home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1994 November: Tool Chest / Dev.CD Nov 94.toast / New System Software Extensions / OpenDoc A6 / SOM / OpenDoc and SOM / IDL / Arbitrat.idl next >
Encoding:
Text File  |  1994-04-19  |  4.5 KB  |  145 lines  |  [TEXT/MPS ]

  1. //# Copyright:    © 1993-94 by Apple Computer, Inc., all rights reserved.
  2. #ifndef _ARBITRAT_
  3. #define _ARBITRAT_
  4.  
  5. #ifndef _ODOBJECT_
  6. #include "ODObject.idl"
  7. #endif
  8.  
  9. //==============================================================================
  10. // Theory of Operation
  11. //==============================================================================
  12.  
  13. /*
  14.   The arbitrator is used to manage competition for facilities which can only
  15.   be controlled by a single part at a time. These facilities are referred to
  16.   as "focus types". An example is the keystroke focus. Keyboard events are
  17.   sent to the part which has the keystroke focus. Another example is the menu
  18.   focus. One part owns the menu bar at any time. Many focus types are related
  19.   to event distribution, but focus types could also be associated with ports,
  20.   for example.
  21.   
  22.   Rather than having an all-encompassing notion of "active" part, parts simply
  23.   request ownership of a set of focus types. It is possible, in principle, to
  24.   have one part receive keystroke events while another receives sound input,
  25.   though the human interface guidelines may encourage parts to request and 
  26.   relinquish most focus types along with the menu focus.
  27.     
  28.   New focus types can be added. This might be done by a part handler which is
  29.   associated with some exotic input device.
  30.   
  31.   Parts request ownership of a set of focus types. This is necessary to 
  32.   avoid deadlock.
  33.     
  34. */
  35.  
  36. //==============================================================================
  37. // Constants
  38. //==============================================================================
  39.  
  40.  
  41. //==============================================================================
  42. // Scalar Types
  43. //==============================================================================
  44.  
  45. //=====================================================================================
  46. // Class defined in this interface
  47. //=====================================================================================
  48.  
  49. interface  ODArbitrator;
  50.  
  51. //=====================================================================================
  52. // Classes used by this interface
  53. //=====================================================================================
  54.  
  55. interface  ODFocusModule;
  56. interface  ODFocusSet;
  57. interface  ODFocusOwnerIterator;
  58. interface  ODSession;
  59. interface  ODFrame;
  60.  
  61. //=====================================================================================
  62. // Implementation Types
  63. //=====================================================================================
  64.  
  65.  
  66. //=====================================================================================
  67. // Global Variables
  68. //=====================================================================================
  69.  
  70. //=====================================================================================
  71. // Class ODArbitrator
  72. //=====================================================================================
  73.  
  74. interface ODArbitrator :  ODObject
  75. {    
  76.    ODBoolean RequestFocusSet(in ODFocusSet focusSet,
  77.                                  in ODFrame requestingFrame);
  78.     
  79.    ODBoolean RequestFocus(in ODTypeToken focus,
  80.                               in ODFrame requestingFrame);
  81.         
  82.    void RelinquishFocusSet(in ODFocusSet focusSet,
  83.                               in ODFrame relinquishingFrame);
  84.         
  85.    void RelinquishFocus(in ODTypeToken focus,
  86.                            in ODFrame relinquishingFrame);
  87.   
  88.    void TransferFocus(in ODTypeToken focus,
  89.                          in ODFrame transferringFrame,
  90.                       in ODFrame newOwner);
  91.                  
  92.    void TransferFocusSet(inout ODFocusSet focusSet, 
  93.                            in ODFrame transferringFrame,
  94.                         in ODFrame newOwner);
  95.                  
  96.    ODFrame GetFocusOwner(in ODTypeToken focus);
  97.     
  98.    ODFocusOwnerIterator CreateOwnerIterator(in ODTypeToken focus);
  99.           
  100.    void RegisterFocus(in ODTypeToken focus,
  101.                          in ODFocusModule focusModule);
  102.       
  103.    void UnregisterFocus(in ODTypeToken focus);
  104.  
  105.    ODBoolean IsFocusRegistered(in ODTypeToken focus);
  106.   
  107.    ODBoolean IsFocusExclusive(in ODTypeToken focus);
  108.   
  109.  
  110. #ifdef __SOMIDL__
  111.   implementation
  112.   {
  113.     override:
  114.         somInit,
  115.         somUninit,
  116.         Purge;
  117.     releaseorder:
  118.         RequestFocusSet,
  119.         RequestFocus,
  120.         RelinquishFocusSet,
  121.         RelinquishFocus,
  122.         TransferFocus,
  123.         TransferFocusSet,
  124.         GetFocusOwner,
  125.         CreateOwnerIterator,
  126.         RegisterFocus,
  127.         UnregisterFocus,
  128.         IsFocusRegistered,
  129.         IsFocusExclusive,
  130.         reserved1,
  131.         reserved2,
  132.         reserved3,
  133.         reserved4,
  134.         reserved5,
  135.         reserved6;
  136.  
  137.         majorversion = 1; minorversion = 0;
  138.  
  139.     
  140.   };
  141. #endif
  142. };
  143.  
  144. #endif // _ARBITRAT_
  145.